import axios from '../request'

export const registerApi = (phone, pwd, name) => axios.post("/api/v1/pri/user/register", {
    "phone": phone,
    "pwd": pwd,
    "name": name
})
export const loginApi = (phone, pwd) => axios.post("/api/v1/pri/user/login", {
    phone,
    pwd
})
export const getBanner = () => axios.get("/api/v1/pub/video/list_banner")
export const getVideoList = () => axios.get("/api/v1/pub/video/list")
export const getVideoDetail = (vid) => axios.get("/api/v1/pub/video/find_detail_by_id?", {
    params: {
        video_id: vid
    }
})
export const saveOrder = (token, vid) => axios.post("/api/v1/pri/order/save", {
    "video_id": vid
}, {
    headers: {
        "token": token
    }
})
export const getOrderList = (token) => axios.get("/api/v1/pri/order/list", {
    params: { token }
})
export const getUserInfo = (token) => axios.get("/api/v1/pri/user/find_by_token", {
    params: { token }
})